package com.yuanfeng.order.controller;


import com.yuanfeng.commoms.util.ResponseResult;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @ClassName OrderComplaintsController
 * @Description  用户投诉表
 * @Author cyp
 * @Date 2023-08-23 09:38:14
 * @Version 1.0
 **/
@RestController
@RequestMapping("order/complaints")
public class OrderComplaintsController extends BaseController {

    /**
     * 用户新增投诉单
     */
    @PostMapping("/add")
    public ResponseResult addcomplaints(@RequestBody Map<String,Object> map){
        ResponseResult addcomplaints = orderComplaintsService.addcomplaints(map);
        return addcomplaints;
    }

    /**
     * 判断订单是否在发货周期
     */
    @PostMapping("/query")
    public ResponseResult query(@RequestBody Map<String,Object> map){
        ResponseResult query = orderComplaintsService.query(map);
        return query;
    }

    /**
     * 查询订单最后售后时间
     */
    @PostMapping("/isAfterSales")
    public ResponseResult isAfterSales(@RequestBody Map<String,Object> map){
        ResponseResult afterSales = orderComplaintsService.isAfterSales(map);
        return afterSales;
    }
    /**
     * 查询订单是否投诉过
     */
    @PostMapping("/isComplaints")
    public ResponseResult isComplaints(@RequestBody Map<String,Object> map){
        ResponseResult complaints = orderComplaintsService.isComplaints(map);
        return complaints;
    }
    /**
     * 查询投诉单列表
     */
    @PostMapping("/queryComplaints")
    public ResponseResult queryComplaints(@RequestBody Map<String,Object> map){
        ResponseResult result = orderComplaintsService.queryComplaints(map);
        return result;
    }

    /**
     * 查询投诉单详情
     */
    @PostMapping("/complaintsDetail")
    public ResponseResult complaintsDetail(@RequestBody Map<String,Object> map){
        ResponseResult result = orderComplaintsService.complaintsDetail(map);
        return result;
    }

    /**
     * 撤销投诉单
     */
    @PostMapping("/revokeComplaints")
    public ResponseResult revokeComplaints(@RequestBody Map<String,Object> map){
        ResponseResult result = orderComplaintsService.revokeComplaints(map);
        return result;
    }


    /**
     * 平台-查询投诉列表
     */
    @PostMapping("/platform/queryComplaints")
    public ResponseResult queryComplaintsByPlatform(@RequestBody Map<String,Object> map){
        ResponseResult result = orderComplaintsService.queryComplaintsByPlatform(map);
        return result;
    }

    /**
     * 平台-查询投诉详情
     */
    @PostMapping("/platform/queryComplaintsDetail")
    public ResponseResult queryComplaintsDetailByPlatform(@RequestBody Map<String,Object> map){
        ResponseResult result = orderComplaintsService.queryComplaintsDetailByPlatform(map);
        return result;
    }


    /**
     * 平台-处理投诉
     */
    @PostMapping("/platform/updateComplaint")
    public ResponseResult updateComplaint(@RequestBody Map<String,Object> map){
        ResponseResult result = orderComplaintsService.updateComplaint(map);
        return result;
    }
}
